import { createRouter, createWebHashHistory } from 'vue-router'
//createMemoryHistory,createWebHashHistory,
//createWebHistory,用着这种前端路由路径，需要后端配合，用connect这个包解决
const LoginIndex = () => import('../views/Login/index.vue')
const Login = () => import('../views/Login/Login.vue')
const Register = () => import('../views/Login/Register.vue')
const ForgetPassw = () => import('../views/Login/ForgetPassw.vue')
const ResetPassword = () => import('../views/Login/ResetPassword.vue')
const InfoImprove = () => import('../views/Login/InfoImprove.vue')
const Home = () => import('../views/Home.vue')

export default createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/home',
      component: Home
    },
    {
      path: '/login-manage',
      redirect: '/login-manage/login',
      component: LoginIndex,
      children: [
        {
          path: 'login',
          component: Login
        },
        {
          path: 'register',
          component: Register
        },
        {
          path: 'forgetpassw',
          component: ForgetPassw
        },
        {
          path: 'resetpassword',
          component: ResetPassword
        },
        {
          path: 'infoimprove',
          component: InfoImprove
        }
      ]
    }
  ]
})
